﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Edutainment
{
	/// <summary>
	/// Interaktionslogik für UserControl1.xaml
	/// </summary>
    /// 
	public partial class MainMenu : UserControl
	{
        BubbleSortWindow bubbleSortWindow;
		public MainMenu()
		{
			this.InitializeComponent();
            this.backButton.Visibility = Visibility.Hidden;
            bubbleSortWindow = new BubbleSortWindow();
		}

        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
           
        }

        private void doBubbleSort(object sender, System.Windows.RoutedEventArgs e)
        {
            this.title.Text = "Bubblesort";
            this.backButton.Visibility = Visibility.Visible;
            this.LayoutRoot.Children.Remove(mainContent);
          
            bubbleSortWindow.Visibility = Visibility.Visible;
            this.LayoutRoot.Children.Add(bubbleSortWindow);
        }

        private void doMergeSort(object sender, System.Windows.RoutedEventArgs e)
        {
            this.title.Text = "Merge Sort";
            this.backButton.Visibility = Visibility.Visible;
            this.LayoutRoot.Children.Remove(mainContent);
        }

        private void backButton_TouchDown_1(object sender, TouchEventArgs e)
        {
            reInitMenu();
        }

        private void reInitMenu()
        {
            this.title.Text = "Sortieralgorithmen";
            this.backButton.Visibility = Visibility.Hidden;
            this.LayoutRoot.Children.Remove(bubbleSortWindow);
            this.LayoutRoot.Children.Add(mainContent);
        }
        private void backButton_MouseDown_1(object sender, MouseButtonEventArgs e)
        {
            reInitMenu();
        }
	}
}